﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.ComponentModel;

namespace TVProgramAnalyst.Helper
{
    public  class ReflectionHelper
    {
        public static string getDisplayName(MemberInfo mi)
        {

            object[] atts = mi.GetCustomAttributes(typeof(DisplayNameAttribute), false);
            if (atts.Length > 0)
            {
                DisplayNameAttribute da = atts[0] as DisplayNameAttribute;
                return da.DisplayName;
            }
            return mi.Name;
        }

    }
}
